package com.loveyukari.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.loveyukari.dao.PhoneCodeDao;
import com.loveyukari.model.PhoneCode;

/**
*
*yangshaohua
*2017年8月9日下午4:00:58
**/
@Service
public class PhoneCodeService {

	@Autowired
	private PhoneCodeDao phoneCodeDao;
	
	
	public void addPhoneCode(String phone,String code,String type){
		PhoneCode phoneCode = new PhoneCode();
		phoneCode.setPhone(phone);
		phoneCode.setCode(code);
		phoneCode.setType(type);
		phoneCodeDao.insertPhoneCode(phoneCode);
	}
	
	public PhoneCode getPhoneCode(String phone,String code,String type){
		PhoneCode phoneCode = phoneCodeDao.selectPhoneCode(phone, code, type);
		return phoneCode;
	}
	
	public void editPhoneCodeStatus(int id,int status){
		phoneCodeDao.updatePhoneCodeStatus(id, status);
	}
	
	
}
